bitmask: add an assertion
authorMatthias Clasen <mclasen@redhat.com>
Mon, 25 May 2020 21:18:27 +0000 (17:18 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 26 May 2020 00:56:09 +0000 (20:56 -0400)
The static analysis in ci is complaining about
this, since it doesn't know that start is always
smaller than end.

gtk/gtkbitmaskprivateimpl.h

index 3a16e178fcc88b1e942ccce23142d721124e30a0..d9598528c5f022fcfd5fb31a8ad9b0a84d09bf9c 100644 (file)
@@ -124,6 +124,8 @@ _gtk_bitmask_invert_range (GtkBitmask *mask,
                            guint       start,
                            guint       end)
 {
+  g_assert (start <= end);
+
   if (_gtk_bitmask_is_allocated (mask) ||
       (end > GTK_BITMASK_N_DIRECT_BITS))
     return _gtk_allocated_bitmask_invert_range (mask, start, end);